home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / languages / obrn-a_1.5_lib.lha / oberon-a / source1.lha / source / amiga / DiskFont.mod < prev    next >
Encoding:
Text File  |  1995-01-26  |  20.8 KB  |  565 lines

  1. (***************************************************************************
  2.  
  3.      $RCSfile: DiskFont.mod $
  4.   Description: Interface to diskfont.library
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.7 $
  8.       $Author: fjc $
  9.         $Date: 1995/01/26 02:39:55 $
  10.  
  11.   Includes Release 40.15
  12.  
  13.   (C) Copyright 1985-1993 Commodore-Amiga, Inc.
  14.       All Rights Reserved
  15.  
  16.   Oberon-A interface Copyright © 1994-1995, Frank Copeland.
  17.   This file is part of the Oberon-A Interface.
  18.   See Oberon-A.doc for conditions of use and distribution.
  19.  
  20. ***************************************************************************)
  21.  
  22. <* STANDARD- *> <* INITIALISE- *> <* MAIN- *>
  23. <*$ CaseChk-  IndexChk- LongVars+ NilChk-  *>
  24. <*$ RangeChk- StackChk- TypeChk-  OvflChk- *>
  25.  
  26. MODULE [2] DiskFont;
  27.  
  28. IMPORT
  29.   SYS := SYSTEM, Kernel, e := Exec, d := Dos, u := Utility, gfx := Graphics,
  30.   s := Sets;
  31.  
  32.  
  33. (*
  34. **      $VER: diskfont.h 38.0 (18.6.92)
  35. **
  36. **      diskfont library definitions
  37. **
  38. **      (C) Copyright 1990 Robert R. Burns
  39. **          All Rights Reserved
  40. *)
  41.  
  42.  
  43. CONST
  44.  
  45.   maxFontPath * = 256;   (* including null terminator *)
  46.  
  47. TYPE
  48.  
  49.   FontContentsPtr * = POINTER TO FontContents;
  50.   FontContents * = RECORD
  51.     fileName * : ARRAY maxFontPath OF CHAR;
  52.     ySize *    : e.UWORD;
  53.     style *    : s.SET8;
  54.     flags *    : s.SET8;
  55.   END; (* FontContents *)
  56.  
  57.   TFontContentsPtr * = POINTER TO TFontContents;
  58.   TFontContents * = RECORD
  59.     fileName * : ARRAY maxFontPath - 2 OF CHAR;
  60.     tagCount * : e.UWORD;       (* including the tagDONE tag *)
  61.     (*
  62.      *  if tagCount is non-zero, fileName is overlayed with
  63.      *  Text Tags starting at:  SYS.VAL (u.TagItemPtr,
  64.      *    SYS.ADR (fileName[maxFontPath-(tagCount*SIZE (u.TagItem))]))
  65.      *)
  66.     ySize *    : e.UWORD;
  67.     style *    : s.SET8;
  68.     flags *    : s.SET8;
  69.   END; (* TFontContents *)
  70.  
  71.  
  72. CONST
  73.  
  74.   fchId *  = 0F00H;  (* FontContentsHeader, then FontContents *)
  75.   tfchId * = 0F02H;  (* FontContentsHeader, then TFontContents *)
  76.   ofchId * = 0F03H;  (* FontContentsHeader, then TFontContents,
  77.                       * associated with outline font *)
  78.  
  79. TYPE
  80.  
  81.   FontContentsHeaderPtr * = POINTER TO FontContentsHeader;
  82.   FontContentsHeader * = RECORD
  83.     fileID *     : e.UWORD; (* fchID *)
  84.     numEntries * : e.UWORD; (* the number of FontContents elements *)
  85.   (**fc *         : ARRAY numEntries OF FontContents or
  86.     tfc *        : ARRAY numEntries OF TFontContents *)
  87.   END; (* FontContentsHeader *)
  88.  
  89.  
  90. CONST
  91.  
  92.   dfhId *       = 0F80H;
  93.   maxFontName * =    32; (* font name including ".font\0" *)
  94.  
  95. TYPE
  96.  
  97.   DiskFontHeaderPtr * = POINTER TO DiskFontHeader;
  98.  
  99.     (* the following 8 bytes are not actually considered a part of the  *)
  100.     (* DiskFontHeader, but immediately preceed it. The nextSegment is   *)
  101.     (* supplied by the linker/loader, and the returnCode is the code    *)
  102.     (* at the beginning of the font in case someone runs it...          *)
  103.     (*   nextSegment : e.ULONG;              (* actually a BPTR *)      *)
  104.     (*   returnCode  : e.ULONG;              (* MOVEQ #0,D0 : RTS *)    *)
  105.     (* here then is the official start of the DiskFontHeader...         *)
  106.   DiskFontHeader * = RECORD (e.NodeBase)
  107.     df *       : e.Node;             (* node to link disk fonts *)
  108.     fileID *   : e.UWORD;            (* dfhID *)
  109.     revision * : e.UWORD;            (* the font revision *)
  110.     segment *  : e.BPTR;             (* the segment address when loaded *)
  111.     name *     : ARRAY maxFontName OF CHAR; (* the font name (null terminated) *)
  112.     tf *       : gfx.TextFont;       (* loaded TextFont structure *)
  113.   END; (* DiskFontHeader *)
  114.  
  115. (* unfortunately, this needs to be explicitly typed *)
  116. (* used only if tf.tfStyle fsTagged bit is set *)
  117.  
  118. (*  DiskFontHeader.tagList = DiskFontHeader.segment; (* destroyed during loading *)*)
  119.  
  120.  
  121. CONST
  122.  
  123.   memory * = 0;
  124.   disk * =   1;
  125.   scaled * = 2;
  126.   bitmap * = 3;
  127.  
  128.   tagged * = 16;      (* return TAvailFonts *)
  129.  
  130. TYPE
  131.  
  132.   AvailFontPtr * = POINTER TO AvailFont;
  133.   AvailFont * = RECORD
  134.     type * : s.SET16;        (* MEMORY, DISK, or SCALED *)
  135.     attr * : gfx.TextAttr;    (* text attributes for font *)
  136.   END; (* AvailFont *)
  137.  
  138.   TAvailFontPtr * = POINTER TO TAvailFont;
  139.   TAvailFont * = RECORD
  140.     Type * : s.SET16;       (* MEMORY, DISK, or SCALED *)
  141.     Attr * : gfx.TTextAttr;  (* text attributes for font *)
  142.   END; (* TAvailFont *)
  143.  
  144.   AvailFontsHeaderPtr * = POINTER TO AvailFontsHeader;
  145.   AvailFontsHeader * = RECORD
  146.     numEntries * : e.UWORD;      (* number of AvailFonts elements *)
  147.   (**af *         : ARRAY numEntries OF AvailFont or
  148.     taf *         : ARRAY numEntries OF TAvailFont*)
  149.   END; (* AvailFontsHeader *)
  150.  
  151.  
  152. (*
  153. **      $VER: diskfonttag.h 10.4 (14.7.92)
  154. **
  155. **      libraries/diskfonttag.h -- tag definitions for .otag files
  156. **
  157. **      (C) Copyright 1990-1992 Robert R. Burns
  158. **          All Rights Reserved
  159. *)
  160.  
  161. CONST
  162.  
  163. (* Level 0 entries never appear in the .otag tag list, but appear in font
  164.  * specifications *)
  165.    level0 *   =   u.user;
  166. (* Level 1 entries are required to exist in the .otag tag list *)
  167.    level1 *   =   u.user + 1000H;
  168. (* Level 2 entries are optional typeface metric tags *)
  169.    level2 *   =   u.user + 2000H;
  170. (* Level 3 entries are required for some engines *)
  171.    level3 *   =   u.user + 3000H;
  172. (* Indirect entries are at (tag address + data offset) *)
  173.    indirect * =   8000H;
  174.  
  175. (********************************************************************)
  176. (* font specification and inquiry tags *)
  177.  
  178. (* !  tags flagged with an exclaimation mark are valid for
  179.  *    specification.
  180.  *  ? tags flagged with a question mark are valid for inquiry
  181.  *
  182.  * fixed binary numbers are encoded as 16 bits of integer and
  183.  * 16 bits of fraction.  Negative values are indicated by twos
  184.  * complement of all 32 bits.
  185.  *)
  186.  
  187. (* !  deviceDPI specifies the target device dots per inch -- X DPI is
  188.  *    in the high word, Y DPI in the low word. *)
  189.   deviceDPI * = level0 + 01H;                (* == taDeviceDPI *)
  190.  
  191. (* !  dotSize specifies the target device dot size as a percent of
  192.  *    it's resolution-implied size -- X percent in high word, Y percent
  193.  *    in low word. *)
  194.   dotSize * = level0 + 02H;
  195.  
  196. (* !  OT_Point_Height specifies the requested point height of a typeface,
  197.  *    specifically, the height and nominal width of the em-square.
  198.  *    The point referred to here is 1/72".  It is encoded as a fixed
  199.  *    binary number. *)
  200.   pointHeight * = level0 + 08H;
  201.  
  202. (* !  setFactor specifies the requested set width of a typeface.
  203.  *    It distorts the width of the em-square from that specified by
  204.  *    pointHeight.  To compensate for a device with different
  205.  *    horizontal and vertical resolutions, deviceDpi should be used
  206.  *    instead.  For a normal aspect ratio, set to 1.0 (encoded as
  207.  *    0x00010000).  This is the default value. *)
  208.   setFactor * = level0 + 09H;
  209.  
  210. (* !  shear... specifies the Sine and Cosine of the vertical stroke
  211.  *    angle, as two fixed point binary fractions.  Both must be specified:
  212.  *    first the Sine and then the Cosine.  Setting the sine component
  213.  *    changes the Shear to an undefined value, setting the cosine
  214.  *    component completes the Shear change to the new composite value.
  215.  *    For no shear, set to 0.0, 1.0 (encoded as 0x00000000, 0x00010000).
  216.  *    This is the default value. *)
  217.   shearSin * = level0 + 0AH;
  218.   shearCos * = level0 + 0BH;
  219.  
  220. (* !  rotate... specifies the Sine and Cosine of the baselin rotation
  221.  *    angle, as two fixed point binary fractions.  Both must be specified:
  222.  *    first the Sine and then the Cosine.  Setting the sine component
  223.  *    changes the Shear to an undefined value, setting the cosine
  224.  *    component completes the Shear change to the new composite value.
  225.  *    For no shear, set to 0.0, 1.0 (encoded as 0x00000000, 0x00010000).
  226.  *    This is the default value. *)
  227.   rotateSin * = level0 + 0CH;
  228.   rotateCos * = level0 + 0DH;
  229.  
  230. (* !  embolden... specifies values to algorithimically embolden -- or,
  231.  *    when negative, lighten -- the glyph.  It is encoded as a fixed point
  232.  *    binary fraction of the em-square.  The X and Y components can be
  233.  *    changed indendently.  For normal characters, set to 0.0, 0.0
  234.  *    (encoded as 0x00000000, 0x00000000).  This is the default value. *)
  235.   emboldenX * = level0 + 0EH;
  236.   emboldenY * = level0 + 0FH;
  237.  
  238. (* !  pointSize is an old method of specifying the point size,
  239.  *    encoded as (points * 16). *)
  240.   pointSize * = level0 + 10H;
  241.  
  242. (* !  glyphCode specifies the glyph (character) code to use with
  243.  *    subsequent operations.  For example, this is the code for an
  244.  *    glyph inquiry *)
  245.   glyphCode * = level0 + 11H;
  246.  
  247. (* !  glyphCode2 specifies the second glyph code.  For example,
  248.  *    this is the right glyph of the two glyphs of an kernPair
  249.  *    inquiry *)
  250.   glyphCode2 * = level0 + 12H;
  251.  
  252. (* !  glyphWidth specifies a specific width for a glyph.
  253.  *    It sets a specific escapement (advance) width for subsequent
  254.  *    glyphs.  It is encoded as a fixed binary fraction of the em-square.
  255.  *    To revert to using the font-defined escapement for each glyph, set
  256.  *    to 0.0 (encoded as 0x00000000).  This is the default value. *)
  257.   glyphWidth * = level0 + 13H;
  258.  
  259. (* !  oTagPath and
  260.  * !  oTagList specify the selected typeface.  Both must be specified:
  261.  *    first the Path and then the List.  Setting the path name changes
  262.  *    changes the typeface to an undefined value, providing the List
  263.  *    completes the typeface selection to the new typeface.  OTagPath
  264.  *    is the null terminated full file path of the .otag file associated
  265.  *    with the typeface.  OTagList is a memory copy of the processed
  266.  *    contents of that .otag file (i.e. with indirections resolved).
  267.  *    There are no default values for the typeface. *)
  268.   oTagPath * = level0 + indirect + 14H;
  269.   oTagList * = level0 + indirect + 15H;
  270.  
  271. (*  ? glyphMap supplies a read-only struct GlyphMap pointer that
  272.  *    describes a bitmap for a glyph with the current attributes. *)
  273.   glyphMap * = level0 + indirect + 20H;
  274.  
  275. (*  ? widthList supplies a read-only struct MinList of struct
  276.  *    GlyphWidthEntry nodes for glyphs that are defined from GlyphCode
  277.  *    to GlyphCode2, inclusive.  The widths are represented as fixed
  278.  *    binary fractions of the em-square, ignoring any effect of
  279.  *    SetFactor or GlyphWidth.  A width would need to be converted to
  280.  *    a distance along the baseline in device units by the
  281.  *    application. *)
  282.   widthList * = level0 + indirect + 21H;
  283.  
  284. (*  ? ...KernPair supplies the kern adjustment to be added to the
  285.  *    current position after placement of the GlyphCode glyph and
  286.  *    before placement of the GlyphCode2 glyph.  Text kern pairs are
  287.  *    for rendering body text.  Display kern pairs are generally
  288.  *    tighter values for display (e.g. headline) purposes.  The
  289.  *    adjustment is represented as a fixed binary fraction of the
  290.  *    em-square, ignoring any effect of SetFactor.  This number would
  291.  *    need to be converted to a distance along the baseline in device
  292.  *    units by the application. *)
  293.   textKernPair * = level0 + indirect + 22H;
  294.   designKernPair * = level0 + indirect + 23H;
  295.  
  296. (*  ? underlined is an unsigned word which is used to request
  297.  *    algorithimic underlining for the engine when rendering the glyph.
  298.  *    Bullet.library currently does not support this tag, though it
  299.  *    may be used by other engines in the future.  The default for
  300.  *    any engine which supports this tag must be ulNone.  Engines which
  301.  *    do not support this tag should return an appropriate err value.
  302.  *
  303.  *    As of V39, diskfont.library will request underlining if specified
  304.  *    in the TextAttr, or TTextAttr passed to OpenDiskFont().  Diskfont
  305.  *    will first request Broken underlining (like the Text() function
  306.  *    does when SetSoftStyle() is used), and then Solid underlining if
  307.  *    the engine returns an error.  If the engine returns an error for
  308.  *    both, then diskfont.library attempts to find, or create the best
  309.  *    non-underlined font that it can. *)
  310.   underLined * = level0 + 24H;
  311.  
  312.   ulNone * = 0;
  313.   ulSolid * = 1;
  314.   ulBroken * = 2;
  315.   ulDoubleSolid * = 3;
  316.   outlDoubleBroken * = 4;
  317.  
  318. (*  ? strikeThrough is a boolean which is used to request
  319.  *    algorithimic strike through when rendering the glyph.
  320.  *    Bullet.library currently does not support this tag, though it
  321.  *    may be used by other engines in the future.  The default for
  322.  *    any engined which supports this tag must be FALSe.  Engines which
  323.  *    do not support this tag should return an appropriate err value. *)
  324.   strikeThrough * = level0 + 25H;
  325.  
  326. (********************************************************************)
  327. (* .otag tags *)
  328.  
  329. (* suffix for files in FONTS: that contain these tags *)
  330.    suffix * =      ".otag";
  331.  
  332. (* fileIdent both identifies this file and verifies its size.
  333.  * It is required to be the first tag in the file. *)
  334.    fileIdent * =   level1 + 01H;
  335.  
  336. (* engine specifies the font engine this file is designed to use *)
  337.    engine * =      level1 + indirect + 02H;
  338.    eBullet * =     "bullet";
  339.  
  340. (* family is the family name of this typeface *)
  341.    family * =      level1 + indirect + 03H;
  342.  
  343. (* The name of this typeface is implicit in the name of the .otag file *)
  344. (* bName is used to find the bold variant of this typeface *)
  345.    bName * =       level2 + indirect + 05H;
  346. (* iName is used to find the italic variant of this typeface *)
  347.    iName * =       level2 + indirect + 06H;
  348. (* biName is used to find the bold italic variant of this typeface *)
  349.    biName * =      level2 + indirect + 07H;
  350.  
  351. (* symSet is used to select the symbol set that has the otYSizeFactor
  352.  * described here.  Other symbol sets might have different extremes *)
  353.    symbolSet * =   level1 + 10H;
  354.  
  355. (* ySizeFactor is a ratio to assist in calculating the Point height
  356.  * to BlackHeight relationship -- high word: Point height term, low
  357.  * word: Black height term -- pointSize * = ysize*<high>/<low> *)
  358.    ySizeFactor * = level1 + 11H;
  359.  
  360. (* spaceWidth specifies the width of the space character relative
  361.  * to the character height *)
  362.    spaceWidth * =  level2 + 12H;
  363.  
  364. (* isFixed is a boolean indicating that all the characters in the
  365.  * typeface are intended to have the same character advance *)
  366.    isFixed * =     level2 + 13H;
  367.  
  368. (* serifFlag is a boolean indicating if the character has serifs *)
  369.    serifFlag * =   level1 + 14H;
  370.  
  371. (* stemWeight is an unsigned byte indicating the weight of the character *)
  372.    stemWeight * =  level1 + 15H;
  373.  
  374.    sUltraThin *  =   8;     (*   0- 15 *)
  375.    sExtraThin *  =  24;     (*  16- 31 *)
  376.    sThin *       =  40;     (*  32- 47 *)
  377.    sExtraLight * =  56;     (*  48- 63 *)
  378.    sLight *      =  72;     (*  64- 79 *)
  379.    sDemiLight *  =  88;     (*  80- 95 *)
  380.    sSemiLight *  = 104;     (*  96-111 *)
  381.    sBook *       = 120;     (* 112-127 *)
  382.    sMedium *     = 136;     (* 128-143 *)
  383.    sSemiBold *   = 152;     (* 144-159 *)
  384.    sDemiBold *   = 168;     (* 160-175 *)
  385.    sBold *       = 184;     (* 176-191 *)
  386.    sExtraBold *  = 200;     (* 192-207 *)
  387.    sBlack *      = 216;     (* 208-223 *)
  388.    sExtraBlack * = 232;     (* 224-239 *)
  389.    sUltraBlack * = 248;     (* 240-255 *)
  390.  
  391. (* slantStyle is an unsigned byte indicating the font posture *)
  392.    slantStyle * = level1 + 16H;
  393.    sUpright *    = 0;
  394.    sItalic *     = 1;       (* Oblique, Slanted, etc. *)
  395.    sLeftItalic * = 2;       (* Reverse Slant *)
  396.  
  397. (* horizStyle is an unsigned byte indicating the appearance width *)
  398.    horizStyle *       = level1 + 17H;
  399.    hUltraCompressed * =  16;     (*   0- 31 *)
  400.    hExtraCompressed * =  48;     (*  32- 63 *)
  401.    hCompressed *      =  80;     (*  64- 95 *)
  402.    hCondensed *       = 112;     (*  96-127 *)
  403.    hNormal *          = 144;     (* 128-159 *)
  404.    hSemiExpanded *    = 176;     (* 160-191 *)
  405.    hExpanded *        = 208;     (* 192-223 *)
  406.    hExtraExpanded *   = 240;     (* 224-255 *)
  407.  
  408. (* spaceFactor specifies the width of the space character relative
  409.  * to the character height *)
  410.    spaceFactor * = level2 + 18H;
  411.  
  412. (* inhibitAlgoStyle indicates which style bits, if any, should
  413.  * be ignored even if the font does not already have that quality.
  414.  * For example, if fsBold is set and the typeface is not bold but
  415.  * the user specifies bold, the application or diskfont library is
  416.  * not to use embolden to achieve a bold result. *)
  417.    inhibitAlgoStyle * = level2 + 19H;
  418.  
  419. (* availSizes is an indirect pointer to sorted UWORDs, 0th is count *)
  420.    availSizes * = level1 + indirect + 20H;
  421.    maxAvailSizes * =      20;      (* no more than 20 sizes allowed *)
  422.  
  423. (* specCount is the count number of parameters specified here *)
  424.    specCount * =  level1 + 100H;
  425.  
  426. (* specs can be created as appropriate for the engine by ORing in the
  427.  * parameter number (1 is first, 2 is second, ... up to 15th) *)
  428.    spec * =       level1 + 100H;
  429. (* spec1 is the (first) parameter to the font engine to select
  430.  * this particular typeface *)
  431.    spec1 * =      level1 + 101H;
  432.  
  433. (*
  434. **      $VER: glyph.h 9.1 (19.6.92)
  435. **
  436. **      glyph.h -- structures for glyph libraries
  437. **
  438. **      (C) Copyright 1991-1992 Robert R. Burns
  439. **          All Rights Reserved
  440. *)
  441.  
  442. TYPE
  443.  
  444. (* A GlyphEngine must be acquired via OpenEngine and is read-only *)
  445.   GlyphEnginePtr * = POINTER TO GlyphEngine;
  446.   GlyphEngine  * = RECORD
  447.     library - : e.LibraryPtr;   (* engine library *)
  448.     name -    : e.LSTRPTR;      (* library basename: e.g. "bullet" *)
  449.     (* private library data follows... *)
  450.   END;
  451.  
  452.   FIXED * = LONGINT;            (* 32 bit signed w/ 16 bits of fraction *)
  453.  
  454.   GlyphMapPtr * = POINTER TO GlyphMap;
  455.   GlyphMap  * = RECORD
  456.     bmModulo *     : e.UWORD;  (* # of bytes in row: always multiple of 4 *)
  457.     bmRows *       : e.UWORD;  (* # of rows in bitmap *)
  458.     blackLeft *    : e.UWORD;  (* # of blank pixel columns at left *)
  459.     blackTop *     : e.UWORD;  (* # of blank rows at top *)
  460.     blackWidth *   : e.UWORD;  (* span of contiguous non-blank columns *)
  461.     blackHeight *  : e.UWORD;  (* span of contiguous non-blank rows *)
  462.     xOrigin *      : FIXED;    (* distance from upper left corner of bitmap *)
  463.     yOrigin *      : FIXED;    (*   to initial CP, in fractional pixels *)
  464.     x0 *           : INTEGER;  (* approximation of XOrigin in whole pixels *)
  465.     y0 *           : INTEGER;  (* approximation of YOrigin in whole pixels *)
  466.     x1 *           : INTEGER;  (* approximation of XOrigin + Width *)
  467.     y1 *           : INTEGER;  (* approximation of YOrigin + Width *)
  468.     width *        : FIXED;    (* character advance, as fraction of em width *)
  469.     bitMap *       : e.APTR;   (* actual glyph bitmap *)
  470.   END;
  471.  
  472.   GlyphWidthEntryPtr * = POINTER TO GlyphWidthEntry;
  473.   GlyphWidthEntry  * = RECORD (e.MinNodeBase)
  474.     node *  : e.MinNode; (* on list returned by widthList inquiry *)
  475.     code *  : e.UWORD;   (* entry's character code value *)
  476.     width * : FIXED;     (* character advance, as fraction of em width *)
  477.   END;
  478.  
  479. (*
  480. **      $VER: oterrors.h 8.1 (19.6.92)
  481. **
  482. **      oterrors.h -- error results from outline libraries
  483. **
  484. **      (C) Copyright 1991-1992 Robert R. Burns
  485. **          All Rights Reserved
  486. *)
  487.  
  488. CONST
  489.  
  490. (* PRELIMINARY *)
  491.   errFailure *      = -1;  (* catch-all for error *)
  492.   errSuccess *      = 0;   (* no error *)
  493.   errBadTag *       = 1;   (* inappropriate tag for function *)
  494.   errUnknownTag *   = 2;   (* unknown tag for function *)
  495.   errBadData *      = 3;   (* catch-all for bad tag data *)
  496.   errNoMemory *     = 4;   (* insufficient memory for operation *)
  497.   errNoFace *       = 5;   (* no typeface currently specified *)
  498.   errBadFace *      = 6;   (* typeface specification problem *)
  499.   errNoGlyph *      = 7;   (* no glyph specified *)
  500.   errBadGlyph *     = 8;   (* bad glyph code or glyph range *)
  501.   errNoShear *      = 9;   (* shear only partially specified *)
  502.   errNoRotate *     = 10;  (* rotate only partially specified *)
  503.   errTooSmall *     = 11;  (* typeface metrics yield tiny glyphs *)
  504.   errUnknownGlyph * = 12;  (* glyph not known by engine *)
  505.  
  506.  
  507. (**-- Library Base variable --------------------------------------------*)
  508.  
  509. CONST
  510.  
  511.   diskfontName * = "diskfont.library";
  512.  
  513. VAR
  514.  
  515.   base *  : e.LibraryPtr;
  516.  
  517.  
  518. (**-- Library Functions ------------------------------------------------*)
  519.  
  520. (*
  521. **      $VER: diskfont_protos.h 38.0 (18.6.92)
  522. *)
  523.  
  524. PROCEDURE OpenDiskFont* [base,-30]
  525.   ( VAR textAttr [8] : gfx.TextAttr )
  526.   : gfx.TextFontPtr;
  527. PROCEDURE AvailFonts* [base,-36]
  528.   ( VAR buffer [8] : ARRAY OF SYS.BYTE;
  529.     bufBytes   [0] : LONGINT;
  530.     flags      [1] : s.SET32 )
  531.   : LONGINT;
  532.  
  533. (* --- functions in V34 or higher (distributed as Release 1.3) ---*)
  534.  
  535. PROCEDURE NewFontContents* [base,-42]
  536.   ( fontsLock [8] : d.FileLockPtr;
  537.     fontName  [9] : ARRAY OF CHAR )
  538.   : FontContentsHeaderPtr;
  539. PROCEDURE DisposeFontContents* [base,-48]
  540.   ( fontContentsHeader [9] : FontContentsHeaderPtr );
  541.  
  542. (* --- functions in V36 or higher (distributed as Release 2.0) ---*)
  543.  
  544. PROCEDURE NewScaledDiskFont* [base,-54]
  545.   ( sourceFont       [8] : gfx.TextFontPtr;
  546.     VAR destTextAttr [9] : gfx.TextAttr )
  547.   : DiskFontHeaderPtr;
  548.  
  549. (**-- Library Base variable --------------------------------------------*)
  550.  
  551. <*$LongVars-*>
  552.  
  553. (**-----------------------------------*)
  554. PROCEDURE* [0] CloseLib (VAR rc : LONGINT);
  555.  
  556. BEGIN (* CloseLib *)
  557.   IF base # NIL THEN e.CloseLibrary (base) END;
  558. END CloseLib;
  559.  
  560. BEGIN
  561.   base := e.OpenLibrary (diskfontName, e.libraryMinimum);
  562.   IF base = NIL THEN HALT (100) END;
  563.   Kernel.SetCleanup (CloseLib)
  564. END DiskFont.
  565.